package eq

import (
	"encoding/json"
	"fmt"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
)

type Text struct {
	ConclusionType uint `json:"conclusion_type"`
}

func Textcen(content string) bool {
	client := censor.NewClient("0z8MYNewsrHDiHdHFflVsSpZ", "WYNTIJZSq9uhJnN6rMRXbEbh34AdVl3G")
	res := client.TextCensor(content)
	fmt.Println(res)
	var resp Text
	json.Unmarshal([]byte(res), &resp)
	fmt.Println(resp)
	if resp.ConclusionType != 1 {
		return false
	}
	return true
}
